/**

 @author 石头哥哥
 </P>
 Date:   2014/12/17
 </P>
 Time:   19:36

 注解：

 */
package {
import lzm.starling.STLConstant;

import starling.animation.IAnimatable;
import starling.display.DisplayObject;

/**
 * 背景移动 处理
 */
public class BgAnimatable implements IAnimatable {


    /**
     * 移动速度
     */
    private var speed:int;
    /**
     * 移动对象
     */
    private var moveObj:DisplayObject;

    /**
     * @param moveObj
     * @param speed
     */
    public function BgAnimatable(moveObj:DisplayObject, speed:int) {
        this.moveObj = moveObj;
        this.speed = speed;
    }


    /**
     *
     * @param time
     */
    public function advanceTime(time:Number):void {
        if (moveObj.y >= moveObj.height) {
            moveObj.y = -moveObj.height;
        }
        moveObj.y += speed;
    }
}
}
